package com.cedric.yixianpai.game.cards.Sects.swordCards.c_JinDan;

import com.cedric.yixianpai.game.Constants.Period;
import com.cedric.yixianpai.game.Status.DuelStatus;
import com.cedric.yixianpai.game.interfaces.SwordCard;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class SanFengJian extends SwordCard {
    /**
     * title:三峰剑
     * effect:3/4/5x3
     */
    public SanFengJian(@Value("1") int lvl) {
        super("三峰剑");
        this.setLevel(lvl);
        this.setPeriod(Period.JINDAN);
        this.setDescription("3/4/5x3攻击");

        if (1 == lvl) {
            this.setDamage(3);
        } else if (2 == lvl) {
            this.setDamage(4);
        } else if (3 == lvl) {
            this.setDamage(5);
        } else {
            throw new RuntimeException("Card Level Error!");
        }
    }

    @Override
    public boolean effect(DuelStatus Sta1, DuelStatus Sta2) {
        for (int i = 0; i < 3; i++) {
            Sta1.attack(Sta2,this.getDamage());
        }
        Sta1.getPlayerBuff().clearSwordIntent();
        return true;
    }
}
